#ifndef __BALLADE_READER_THREAD_H__
#define __BALLADE_READER_THREAD_H__

#pragma once

#include <ballade/util.h>
#include <ballade/network.h>

namespace Ballade
{
	namespace SmartClient
	{
		class HeaderCreater;
		class Dispatcher;

		class ReaderThread
		{
		public:
			ReaderThread(Network::Socket& socket, Dispatcher &dispatcher);
			~ReaderThread();
			void start();
			void stop();
			const bool isTerminated() const;

			void setHeaderCreater(HeaderCreater *creater);

		private:
			bool _terminated;
			Network::Socket &_socket;
			Dispatcher &_dispatcher;
			HeaderCreater *_headerCreater;

			static Util::Logger &Logger_;
			static unsigned __stdcall run(void *args);
		};
	}
}

#endif